package org.aom.litebean.module.base;

import org.operamasks.faces.annotation.Action;
import org.operamasks.faces.annotation.BeforeRender;
import org.operamasks.faces.util.Browser;

public abstract class BaseEntityFormBean extends BaseBean {

	public static String SELECTED_MODULE_ID = "selectedModuleId";
	public static String ACTION_NAME = "action";
	
	protected Long selectedModuleId; 

	protected abstract void processCancel();

	protected abstract void ok();

	@Action(id = "cancel", immediate = true)
	public void cancel() {
		processCancel();
		Browser.execClientScript("window.parent.BtnJsvar.fireEvent('click');");
	}

	@BeforeRender
	protected void beforeRender(boolean isPostBack) {
		initBaseResource();
	}
}
